package demo2;

public class FruitCal {
    public static void main(String[] args) {
        Fruit fru = new Fruit();
        Apple app = new Apple( ) ;
        Banana ban = new Banana( );
        fru.disp( );
        app.disp( );
        ban.disp( );

    }
}

class Fruit{
    void disp( ) {
        System. out.println("我是水果的统称");
    }
}

class Apple extends Fruit{
    @Override
    void disp() {
        System.out.println("我是营养丰富的苹果");
    }
}

class Banana extends Fruit{
    void disp( ) {
        System. out.println("我是营养丰富的香蕉");}
}
